package com.app.internationaltravel.service.impl;

import com.app.internationaltravel.dao.UserDetailDao;
import com.app.internationaltravel.dto.UserDetailDto;
import com.app.internationaltravel.entity.UserDetail;
import com.app.internationaltravel.service.intf.UserDetailService;
import com.app.internationaltravel.vo.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 刘豆豆
 * @date 2022/12/13
 */
@Service
public class UserDetailServiceImpl implements UserDetailService {

  @Resource
  private UserDetailDao dao;

  @Override
  public R upData(UserDetailDto dto) {
    if (dto != null){
      //2.修改
      if (dao.updataDetail(dto)>0){
        return R.ok("修改成功");
      }
    }
    return R.fail("修改失败");
  }

  @Override
  public R queryMy(int uid) {
    return R.ok(dao.queryMy(uid));
  }
}
